package com.example.springaopdemo.proxy;

import java.lang.reflect.Proxy;

public class Main {


    public static void main(String[] args){
    HouseSubject target=new RealHouseSubject();
    //创建代理类
    HouseSubject proxy= (HouseSubject) Proxy.newProxyInstance(
            target.getClass().getClassLoader()
            , new Class[]{HouseSubject.class}
            ,new JDKInvocationHandler(target) );

    proxy.rentHouse();
    proxy.saleHouse();
    }


}
